Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / desktop / src / main / kotlin / org / meshtastic / desktop / notification / DesktopMeshServiceNotifications.kt

Displaying Raw • Download

desktop/src/main/kotlin/org/meshtastic/desktop/notification/DesktopMeshServiceNotifications.kt 9acdf5309f8f0ab96b30d6505bdac5e93a3bb72c (9acdf530) Text, 5.93 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.desktop.notification

Tff7b72import T7ee787org.meshtastic.core.model.ConnectionState
Tff7b72import T7ee787org.meshtastic.core.model.Node
Tff7b72import T7ee787org.meshtastic.core.repository.MeshServiceNotifications
Tff7b72import T7ee787org.meshtastic.core.repository.Notification
Tff7b72import T7ee787org.meshtastic.core.repository.NotificationManager
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.getString
Tff7b72import T7ee787org.meshtastic.core.resources.low_battery_message
Tff7b72import T7ee787org.meshtastic.core.resources.low_battery_title
Tff7b72import T7ee787org.meshtastic.core.resources.new_node_seen
Tff7b72import T7ee787org.meshtastic.proto.ClientNotification
Tff7b72import T7ee787org.meshtastic.proto.Telemetry

T8b949e/**
* Desktop implementation of [MeshServiceNotifications].
*
* Converts mesh-layer notification events into domain [Notification] objects and dispatches them through
* [NotificationManager], which ultimately surfaces them as Compose Desktop tray notifications.
*
* Android-only concepts (notification channels, foreground-service state updates) are intentionally no-ops.
*
* Registered manually in `desktopPlatformStubsModule` -- do **not** add `@Single` to avoid double-registration with the
* `@ComponentScan("org.meshtastic.desktop")` in [DesktopDiModule][org.meshtastic.desktop.di.DesktopDiModule].
*/
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffTooManyFunctionsTa5d6ff"Tb4b4b4)
Tff7b72class T56d364DesktopMeshServiceNotificationsTb4b4b4(Tff7b72private Tff7b72val Te6edf3notificationManagerTb4b4b4: Te6edf3NotificationManagerTb4b4b4) Tb4b4b4: Te6edf3MeshServiceNotifications Tb4b4b4{
Tff7b72override Tff7b72fun Td2a8ffclearNotificationsTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3cancelAllTb4b4b4(Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffinitChannelsTb4b4b4(Tb4b4b4) Tb4b4b4{
T8b949e// No-op: desktop has no Android notification channels.
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffupdateServiceStateNotificationTb4b4b4(Te6edf3stateTb4b4b4: Te6edf3ConnectionStateTb4b4b4, Te6edf3telemetryTb4b4b4: Te6edf3Telemetry?Tb4b4b4) Tb4b4b4{
T8b949e// No-op: desktop has no foreground service notification.
Tb4b4b4}

Tff7b72override Tff7b72suspend Tff7b72fun Td2a8ffupdateMessageNotificationTb4b4b4(
Te6edf3contactKeyTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3messageTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3isBroadcastTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3channelNameTb4b4b4: Tffa657String?Tb4b4b4,
Te6edf3isSilentTb4b4b4: Tffa657BooleanTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Te6edf3nameTb4b4b4,
Te6edf3message Tff7b72= Te6edf3messageTb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3MessageTb4b4b4,
Te6edf3contactKey Tff7b72= Te6edf3contactKeyTb4b4b4,
Te6edf3isSilent Tff7b72= Te6edf3isSilentTb4b4b4,
Te6edf3id Tff7b72= Te6edf3contactKeyTb4b4b4.Te6edf3hashCodeTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72suspend Tff7b72fun Td2a8ffupdateWaypointNotificationTb4b4b4(
Te6edf3contactKeyTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3messageTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3waypointIdTb4b4b4: Tffa657IntTb4b4b4,
Te6edf3isSilentTb4b4b4: Tffa657BooleanTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Te6edf3nameTb4b4b4,
Te6edf3message Tff7b72= Te6edf3messageTb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3MessageTb4b4b4,
Te6edf3contactKey Tff7b72= Te6edf3contactKeyTb4b4b4,
Te6edf3isSilent Tff7b72= Te6edf3isSilentTb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72suspend Tff7b72fun Td2a8ffupdateReactionNotificationTb4b4b4(
Te6edf3contactKeyTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3emojiTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3isBroadcastTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3channelNameTb4b4b4: Tffa657String?Tb4b4b4,
Te6edf3isSilentTb4b4b4: Tffa657BooleanTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Te6edf3nameTb4b4b4,
Te6edf3message Tff7b72= Te6edf3emojiTb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3MessageTb4b4b4,
Te6edf3contactKey Tff7b72= Te6edf3contactKeyTb4b4b4,
Te6edf3isSilent Tff7b72= Te6edf3isSilentTb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffshowAlertNotificationTb4b4b4(Te6edf3contactKeyTb4b4b4: Tffa657StringTb4b4b4, Te6edf3nameTb4b4b4: Tffa657StringTb4b4b4, Te6edf3alertTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3notification Tff7b72=
Te6edf3NotificationTb4b4b4(Te6edf3title Tff7b72= Te6edf3nameTb4b4b4, Te6edf3message Tff7b72= Te6edf3alertTb4b4b4, Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3AlertTb4b4b4, Te6edf3contactKey Tff7b72= Te6edf3contactKeyTb4b4b4)
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(Te6edf3notificationTb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffshowNewNodeSeenNotificationTb4b4b4(Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Te6edf3getStringTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3new_node_seenTb4b4b4, Te6edf3nodeTb4b4b4.Te6edf3userTb4b4b4.Te6edf3short_nameTb4b4b4)Tb4b4b4,
Te6edf3message Tff7b72= Te6edf3nodeTb4b4b4.Te6edf3userTb4b4b4.Te6edf3long_nameTb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3NodeEventTb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffshowOrUpdateLowBatteryNotificationTb4b4b4(Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4, Te6edf3isRemoteTb4b4b4: Tffa657BooleanTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Te6edf3getStringTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3low_battery_titleTb4b4b4, Te6edf3nodeTb4b4b4.Te6edf3userTb4b4b4.Te6edf3short_nameTb4b4b4)Tb4b4b4,
Te6edf3message Tff7b72= Te6edf3getStringTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3low_battery_messageTb4b4b4, Te6edf3nodeTb4b4b4.Te6edf3userTb4b4b4.Te6edf3long_nameTb4b4b4, Te6edf3nodeTb4b4b4.Te6edf3batteryLevel Tff7b72?: T79c0ff0Tb4b4b4)Tb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3BatteryTb4b4b4,
Te6edf3id Tff7b72= Te6edf3nodeTb4b4b4.Te6edf3numTb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffshowClientNotificationTb4b4b4(Te6edf3clientNotificationTb4b4b4: Te6edf3ClientNotificationTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3dispatchTb4b4b4(
Te6edf3NotificationTb4b4b4(
Te6edf3title Tff7b72= Ta5d6ff"Ta5d6ffMeshtasticTa5d6ff"Tb4b4b4,
Te6edf3message Tff7b72= Te6edf3clientNotificationTb4b4b4.Te6edf3messageTb4b4b4,
Te6edf3category Tff7b72= Te6edf3NotificationTb4b4b4.Te6edf3CategoryTb4b4b4.Te6edf3AlertTb4b4b4,
Te6edf3id Tff7b72= Te6edf3clientNotificationTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3hashCodeTb4b4b4(Tb4b4b4)Tb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffcancelMessageNotificationTb4b4b4(Te6edf3contactKeyTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3cancelTb4b4b4(Te6edf3contactKeyTb4b4b4.Te6edf3hashCodeTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffcancelLowBatteryNotificationTb4b4b4(Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3cancelTb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3numTb4b4b4)
Tb4b4b4}

Tff7b72override Tff7b72fun Td2a8ffclearClientNotificationTb4b4b4(Te6edf3notificationTb4b4b4: Te6edf3ClientNotificationTb4b4b4) Tb4b4b4{
Te6edf3notificationManagerTb4b4b4.Te6edf3cancelTb4b4b4(Te6edf3notificationTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3hashCodeTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.05s